package apiday01.homework.object;

public class EqualsDemo {
    public static void main(String[] args) {
        String s1 = new String("hello");
        String s2 = new String("hello");
        System.out.println(s1.equals(s2));//true

        StringBuilder builder1 = new StringBuilder("hello");
        StringBuilder builder2 = new StringBuilder("hello");
        System.out.println(builder1.equals(builder2));//false,未重写equals()
        System.out.println(s1.equals(builder1));//false，类型不同



    }
}
